function saveFigure(figs,name)

width=6;
height=10;
border=0.5;

figure(figs(1))
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
set(gcf,'PaperSize',[width, height])
print([name,'_tracked'],'-dpdf','-r1200');

figure(figs(2));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
myfiguresize = [0, 0, width, height];
print([name,'_no_tracked'],'-dpdf','-r1200');

figure(figs(3));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
myfiguresize = [0, 0, width, height];
print([name,'_inputs'],'-dpdf','-r1200');

figure(figs(4));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, 3, 3];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
set(gcf,'PaperSize',[3, 3])
print([name,'_XY'],'-dpdf','-r1200');

figure(figs(5));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
set(gcf,'PaperSize',[width, height])
print([name,'_error'],'-dpdf','-r1200');

figure(figs(6));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
set(gcf,'PaperSize',[width, height])
print([name,'_track_input'],'-dpdf','-r1200');

figure(figs(7));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
set(gcf,'PaperSize',[width, height])
print([name,'_error_notrack'],'-dpdf','-r1200');

figure(figs(8));
set(gcf,'InvertHardcopy','on');
set(gcf,'PaperUnits', 'inches');
myfiguresize = [0, 0, width, height];
ti = get(gca,'TightInset');
set(gcf,'PaperPosition', myfiguresize);
set(gcf,'PaperSize',[width, height])
print([name,'_all_in'],'-dpdf','-r1200');

% figure(figs(end-1));
% %h=get(gca,'Legend');
% %h=axes('Parent',gcf);
% % set(gca,'Units','inches');
% % set(gca,'Position',[0,0,2,1]);
% set(gcf,'ResizeFcn',[]);
% %set(gcf,'PaperPositionMode','auto')
% set(gcf,'InvertHardcopy','on');
% set(gcf,'PaperUnits', 'inches');
% myfiguresize = [0, 0, 2, 1.4];
% ti = get(gca,'TightInset');
% set(gcf,'PaperPosition', myfiguresize);
% set(gcf,'PaperSize',[2.1, 1.5])
% % set(gca,'Units','inches');
% % set(gca,'Position',[0,0,2,1]);
% %set(gcf,'PaperPositionMode','auto')
% print([name,'_legend'],'-dpdf','-r1200');

end

